package cn.edu.neu.service.impl;

import cn.edu.neu.dao.ScenicSpotDao;
import cn.edu.neu.model.ScenicSpot;
import cn.edu.neu.service.ScenicSpotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScenicSpotServiceImpl implements ScenicSpotService {
    @Autowired
    private ScenicSpotDao scenicspotDao;
    @Override
    public List<ScenicSpot> getScenicSpotList() {
        return scenicspotDao.getScenicSpotList();
    }

    @Override
    public int insertScenicSpot(ScenicSpot scenicSpot) {
        return scenicspotDao.insert(scenicSpot);
    }

    @Override
    public ScenicSpot getScenicSpotById(Integer id) {
        return scenicspotDao.selectByPrimaryKey(id);
    }

    @Override
    public int updateScenicSpot(ScenicSpot scenicSpot) {
        return scenicspotDao.updateByPrimaryKey(scenicSpot);
    }

    @Override
    public int deleteScenicSpot(Integer id) {
        return scenicspotDao.deleteByPrimaryKey(id);
    }
}
